import {readdirSync, statSync} from 'fs'
function findSync(startPath: string) {
  const result: string[] = [];
  function finder(path: string) {
      const files=readdirSync(path);
      files.forEach((val,index) => {
          const fPath=path+val;
          const stats=statSync(fPath);
          if(stats.isFile()) { result.push(fPath); }
      });

  }
  finder(startPath);
  return result;
}
const fileNames = findSync('./');
console.log(fileNames)